﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DoorCtrl : MonoBehaviour
{

    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Ball")
        {
            Debug.Log("进球了");
            Utl.instance.PlaySound("huanhu", false, 1, false, 0, Vector3.zero);
            Utl.instance.WaitForSec(3f, () =>
            {
                other.GetComponent<Rigidbody>().velocity = Vector3.zero;
                other.GetComponent<Rigidbody>().angularVelocity = Vector3.zero;
                other.transform.position = Vector3.zero + Vector3.up;
            });
        }
    }
}
